import { createApp } from 'vue'
// import './style.css'
import App from './App.vue'
import 'vant/lib/index.css';
import router from './router'
import api from './api';

// 在src/main.js进行全局引入
import Vant from 'vant'
import 'vant/lib/index.css';


const app = createApp(App)

//在实例上绑定属性
app.config.globalProperties.$api = api;

router.beforeEach((to, from, next) => {
  if(to.path !== '/login'){
    if(!window.localStorage.getItem('h5_token')){
        return '/login'
    }
  }
})


app.use(router)
app.use(Vant)
app.mount('#app')
